<?php
define('SMARTY_DIR', JPATH_LIBRARIES .'/smarty/libs/');
require_once(SMARTY_DIR. 'Smarty.class.php');
class JSmarty extends Smarty {
    function __construct() {
        //$this->template_dir = JPATH_BASE . '/tmp/smarty/templates';
        $this->compile_dir = JPATH_ROOT . '/tmp/smarty/templates_c';
        $this->config_dir = JPATH_ROOT . '/tmp/smarty/config';
        $this->cache_dir = JPATH_ROOT . '/tmp/smarty/cache';
    }
    function &getInstance() {
        static $instance;
        if(!isset($instance)) {
            $instance = new JSmarty();
        }
        return $instance;
    }
}
?>
